CC		= gcc
WARNINGS	= -Wall
COMPILE		= -pipe -O3 -lpthread
PROC_OPT        = -march=x86-64

CFLAGS = $(WARNINGS) $(COMPILE) $(PROC_OPT)
SRCS    = main.c determine.c backtrack.c grid_utils.c
HEADERS = general.h sudoku.h

_OBJ  = $(SRCS:.c=.o)
ODIR  = objs
OBJS  = $(patsubst %,$(ODIR)/%,$(_OBJ))

sudoku_solver: $(OBJS) $(HEADERS)
	$(CC) $(CFLAGS) $(OBJS) -o $@

$(ODIR)/%.o : %.c $(HEADERS)
	$(CC) $(CFLAGS) -c $< -o $@

default: sudoku_solver

.PHONY: clean

clean:
	rm -f objs/*.o sudoku_solver core *~
